package com.example.evanproject.mapper;

import com.example.evanproject.domain.News;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author hanxiaoqi
* @description 针对表【news】的数据库操作Mapper
* @createDate 2024-03-09 21:52:13
* @Entity generator.domain.News
*/
@Mapper
public interface NewsMapper extends BaseMapper<News> {



    List<News> selectlist(@Param("title") String title, @Param("time1") String time1, @Param("time2") String time2, @Param("typeid") Integer typeid);


    //筛选特定的消息

    List<News> selectbyids(String[] str);


    @Select("select * from news where i_id=#{newId}")
    News selectnewbyid(Integer newId);


    @Insert("insert into news (i_title,i_author,i_time,type_id,i_content) values (#{iTitle},#{iAuthor},#{time},#{typeId},#{iContent})")
    Integer addnew(String iTitle, String iAuthor, String iContent, Integer typeId, String time);

    @Select("select * from news")
    List<News> selectall2();
}




